import styles from './index.less';
import LeftTooltip from "@/components/leftTooltip";
import RightToolUtils from "@/components/boncGpt/rightToolUtils";
import {useLocation} from "umi";
import u510 from "./img/u510.png";
import React,{useState} from "react";
import {history} from "@@/core/history";
import {stopRequest} from "@/utils/requsetApi";
export default function basicLayouts(props) {
  const pathName = useLocation().pathname
   const back = () => {
     stopRequest();
    history.push({
      pathname: '/homePage',
    });
  }


  return (
    <div className={styles.basicLayoutsPage}>
      {pathName === "/login" ? "" : (<img className={styles.icon} src={u510} alt="" onClick={back}/>
      )}
      {pathName === "/login" ? "" : (<div className={styles.rightTool}>
          <RightToolUtils />
        </div>
      )}
      <div className={styles.basicContent}>
        {pathName === "/login" ? "" : <LeftTooltip/>}
      </div>
      <div>{props.children}</div>
    </div>
  );
}
